/*
 * @Author: silence
 * @Date: 2023-03-15 09:23:02
 * @LastEditors: silence silence9685@163.com
 * @LastEditTime: 2023-06-06 11:56:40
 * @Description: 闪屏动画
 */
import 'package:flutter/material.dart';
import '../../../base/SilScaffold.dart';
import 'package:gif_view/gif_view.dart';

class SplashAnimationPage extends StatefulWidget {
  const SplashAnimationPage({Key? key}) : super(key: key);

  @override
  State<SplashAnimationPage> createState() => _SplashAnimationPageState();
}

class _SplashAnimationPageState extends State<SplashAnimationPage> {
  late GifController _gifController;
  bool _animationFinish = false;

  @override
  void initState() {
    super.initState();
    _gifController = GifController(onFinish: () {
      _animationFinish = true;
    });
  }

  @override
  Widget build(BuildContext context) {
    return SilScaffold(
      navBarHide: true,
      sideMargin: 0,
      body: mainWidget(),
    );
  }

  mainWidget(){
    return GifView(
        controller:_gifController,
        image: AssetImage('imgs/common/splash1.gif'),
        height: MediaQuery.of(context).size.height,
        width: MediaQuery.of(context).size.width,
      );
  }
}